package com.zx.service;

import com.zx.dao.UserDao;
import com.zx.entity.User;
import com.zx.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Component;

@Component
public class UserServiceImpl implements UserService{
    SqlSession session= SqlSessionFactoryUtil.getSqlSession();
    UserDao userDao= session.getMapper(UserDao.class);

    public User userLogin(User user) {
        return userDao.selectUser(user);
    }

    public int userEnroll(User user){
        return userDao.insertUser(user);
    }
}
